﻿using System;
using System.Web.UI.WebControls;
using MedicWeb.MedicService;

namespace MedicWeb.forms {
    public partial class GroupExpList : SessionPage {
        protected void Page_Load(object sender, EventArgs e) {
            var ms = new MainService();
            GroupExp[] groupExpList = ms.GetGroupExpList(GetSession(), false);
            foreach (var groupExp in groupExpList) {
                var row = new TableRow();

                var cellEdit = new TableCell();
                var cellId = new TableCell();
                var cellTitle = new TableCell();

                cellEdit.Width = 24;
                cellEdit.Controls.Add(new HyperLink() {
                    CssClass = "edit modal",
                    NavigateUrl = ResolveUrl("~/forms/Editors/GroupExpEdit.aspx?id="+groupExp.Id)
                });
                cellId.Text = "" + groupExp.Id;
                cellTitle.Text = groupExp.Group;

                row.Cells.Add(cellEdit);
                row.Cells.Add(createDeleteCell(groupExp));
                row.Cells.Add(cellId);
                row.Cells.Add(cellTitle);

                tblGroupExp.Rows.Add(row);

            }
        }
    }
}